package com.wy.job;

import com.wy.mapper.UserMapper;
import com.wy.service.UserService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

import static com.wy.controller.UserController.*;

/**
 * @author 33117
 * @version 1.0
 * @data 2025/3/10 17:16
 */
@Component
public class User {
    @Autowired
    UserMapper userMapper;

    @Autowired
    UserService userService;

    @XxlJob(value = "wangyang")
    public void findUser() {
        String name = Name;
        List<com.wy.dao.User> list;
        if (name == null || name.trim().isEmpty()){
            list = userMapper.selectList(null);
        }else {
            List<com.wy.dao.User> listpage1 = userService.listpage(name);
            list = listpage1;
        }
        System.out.println(list);
    }
}
